home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / dsniff / decode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-16  |  891 b   |  44 lines

  1. /*
  2.   decode.h
  3.  
  4.   Protocol decoding routines.
  5.   
  6.   Copyright (c) 2000 Dug Song <dugsong@monkey.org>
  7.  
  8.   $Id: decode.h,v 1.1 2000/05/16 17:31:14 dugsong Exp $
  9. */
  10.  
  11. #ifndef DECODE_H
  12. #define DECODE_H
  13.  
  14. typedef int (*decode_func)(u_char *, int);
  15.  
  16. struct decode {
  17.     char           *dc_name;
  18.     decode_func    dc_func;
  19. };
  20.  
  21. struct decode *getdecodebyname(const char *name);
  22.  
  23.  
  24. #define pletohs(p)    ((u_short)                      \
  25.              ((u_short)*((u_char *)p+1)<<8| \
  26.               (u_short)*((u_char *)p+0)<<0))
  27.      
  28. #define pletohl(p)    ((u_long)*((u_char *)p+3)<<24|  \
  29.              (u_long)*((u_char *)p+2)<<16|  \
  30.              (u_long)*((u_char *)p+1)<<8|   \
  31.              (u_long)*((u_char *)p+0)<<0)
  32.  
  33. u_char *bufbuf(u_char *big, int blen, u_char *little, int llen);
  34.  
  35. int    strip_telopts(u_char *buf, int len);
  36.  
  37. int    strip_lines(char *buf, int max_lines);
  38.  
  39. int    is_ascii_string(char *buf, int len);
  40.  
  41. extern u_char Buf[4096];
  42.  
  43. #endif /* DECODE_H */
  44.